Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Pipeline and TransformedTargetModel to support feature importances #963

Merged
merged 5 commits into from
Mar 17, 2024

Conversation

ablaom
Copy link
Member

@ablaom ablaom commented Mar 15, 2024

A model that supports features importances exposes these via the method feature_importances. However, these importances are hidden if the model is wrapped in TransformedTargetModel or is part of a pipeline. This PR implements feature_importances (and the trait reports_feature_importances) for these two wrappers by forwarding the atomic methods.

For testing purposes, the test model DecisionTreeClassifier in /test/_models/DecisionTree.jl has been updated to support feature importances.

@OkonSamuel

Copy link

codecov bot commented Mar 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.07%. Comparing base (44ca101) to head (059703a).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #963      +/-   ##
==========================================
+ Coverage   88.01%   88.07%   +0.05%     
==========================================
  Files          28       28              
  Lines        2554     2565      +11     
==========================================
+ Hits         2248     2259      +11     
  Misses        306      306              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@OkonSamuel OkonSamuel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. This should also resolve JuliaAI/MLJ.jl#1100.
Thanks @ablaom for looking into this.

@ablaom ablaom merged commit b9e6ac1 into dev Mar 17, 2024
5 checks passed
@ablaom ablaom deleted the feature-importances-wrappers branch March 17, 2024 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants